package com.ycfmedical.bed.ui;

import com.ycfmedical.bed.base.BaseMenuActivity;

import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.ArrayAdapter;

import cn.droidlover.xdroidmvp.router.Router;

/**
 * Created by Administrator on 2017-03-29.
 */

public class DeviceListActivity extends BaseMenuActivity{
    // Debugging
    private static final String TAG = "DeviceListActivity";
    private static final boolean D = true;

    // Return Intent extra
    public static String EXTRA_DEVICE_ADDRESS = "device_address";

    // Member fields
    private BluetoothAdapter mBtAdapter;
    private ArrayAdapter<String> mPairedDevicesArrayAdapter;
    private ArrayAdapter<String> mNewDevicesArrayAdapter;
    String mac;
    @Override
    public void initData(Bundle savedInstanceState) {

        setResult(Activity.RESULT_CANCELED);
        Bundle bundle = this.getIntent().getExtras();
        mac = bundle.getString("TpKey");
        //设置设备地址值到bluetoochat
        Intent intent = new Intent();
        intent.putExtra(EXTRA_DEVICE_ADDRESS, mac);
        // Set result and finish this Activity
        setResult(Activity.RESULT_OK, intent);
        finish();
    }

    @Override
    public int getLayoutId() {
        return 0;
    }

    @Override
    public Object newP() {
        return null;
    }
    public static void launch(Activity activity) {
        Router.newIntent(activity).to(DeviceListActivity.class).launch();
    }
}
